package org.ucas.kgraph.entity;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;

import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

import com.google.common.collect.Lists;

/**
 * 词条的备注文档
 *
 * @author suemi
 */
@Entity
@Table
public class Document extends IdEntity{

  @ManyToMany(fetch=FetchType.EAGER)
  @JoinTable(name="ss_document_doc_file",joinColumns = { @JoinColumn(name = "document_id") }, inverseJoinColumns = { @JoinColumn(name = "doc_file_id") })
  @Fetch(FetchMode.SUBSELECT)
  @OrderBy("id ASC")
  @org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
  private List<DocFile> docList= Lists.newArrayList();
	
	
  @Column(columnDefinition = "TEXT")
  private String content;

  public String getContent() {
    return content;
  }

  public void setContent(String content) {
    this.content = content;
  }

  public List<DocFile> getDocList() {
	return docList;
  }

  public void setDocList(List<DocFile> docList) {
	this.docList = docList;
  }
  
  
}
